const express = require('express');
const router = express.Router();

const data = [];
for(let i = 1; i < 51; i++)
    data.push({
        id: `string${i}`,
        dealerCode: `string${i}`,
        dealerName: `string${i}`,
        marketDepartmentName: `string${i}`,
        country: `string${i}`,
        code: `string${i}`,
        submitDate: '2020-04-01T01:56:53.437Z',
        fobTotalAmount: 100,
        itemCount: 2,
        quantity: 2,
        confirmTime: '2020-04-01T01:56:53.438Z',
        creditAuditedTime: '2020-04-01T01:56:53.438Z',
        transportType: 1,
        shipmentNumber: 0,
        partInvoiceCode: `string${i}`,
        invoiceCreateDate: '2020-04-01T01:56:53.438Z',
        currency: 1,
        itemCountInvoice: `string${i}`,
        totalAmountInvoice: 200,
        totalQuantityInvoice: `string${i}`,
        addupItemCountInvoice: `string${i}`,
        addupTotalAmountInvoice: 200,
        addupTotalQuantityInvoice: `string${i}`,
        addupVarietyRate: 0.2,
        addupMoneyRate: 0.2,
        addupQuantityRate: 0.2,
        shipmentConfirmTime: '2020-04-01T01:56:53.438Z',
        outboundDate: '2020-04-01T01:56:53.438Z',
        shipmentDate: '2020-04-01T01:56:53.438Z',
        stockDay: 0,
        dealerConfirmDay: 0,
        outboundDay: 0,
        documentDay: 0,
        totalShipmentDay: 0,
        actualArrivalDate: '2020-04-01T01:56:53.438Z',
        goLibraryDate: '2020-04-01T01:56:53.438Z',
    });


router.get('/', (req, res) => {
    res.json(
        {
            message: '',
            payload: {
                content: data,
                totalElements: 50,
            }
        }
    );
});
router.get('/export', (req, res) => {
    setTimeout(() => {
        res.json({
            message: '导出成功',
            payload: 'Mock导出'
        });
    }, 1000);
});

module.exports = router;
